package com.service.impl;

import com.entity.Student;
import com.mapper.StudentMapper;
import com.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentSericeImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

/*
查询所有
 */
    @Override
    public List<Student> findStudentAll() {
        return studentMapper.findStudentAll();
    }


    /*
    按照学生姓名查询
     */
    @Override
    public List<Student> findName(String name) {
        return studentMapper.findStudentName(name);
    }

    /*
    按照ID值查询
     */
    @Override
    public Student findById(int id) {
        return studentMapper.findStudentById(id);
    }

    /*
    添加
     */
    @Override
    public void saveStudent(Student student) {
        studentMapper.saveStudent(student);
    }

    @Override
    public List<Student> findAllWithGrade() {
        return studentMapper.findAllWithGrade();
    }


}
